<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      PostgreSQL-12.2
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;22.&nbsp;Databases
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="mariadb.html" title=
          "MariaDB-10.4.12">Prev</a>
          <p>
            MariaDB-10.4.12
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="sqlite.html" title="SQLite-3.31.1">Next</a>
          <p>
            SQLite-3.31.1
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="databases.html" title=
          "Chapter&nbsp;22.&nbsp;Databases">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="postgresql" name="postgresql"></a>PostgreSQL-12.2
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to PostgreSQL
        </h2>
        <p>
          <span class="application">PostgreSQL</span> is an advanced
          object-relational database management system (ORDBMS), derived from
          the Berkeley Postgres database management system.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "http://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2">
                http://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: a88ceea8ecf2741307f663e4539b58b7
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 19 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 185 MB (add 37 MB for tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.6 SBU (with parallelism=4, add 0.1
                SBU for tests)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          PostgreSQL Dependencies
        </h3>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../general/python2.html" title=
          "Python-2.7.17">Python-2.7.17</a>, <a class="xref" href=
          "../general/tcl.html" title="Tcl-8.6.10">Tcl-8.6.10</a>, <a class=
          "xref" href="../general/libxml2.html" title=
          "libxml2-2.9.10">libxml2-2.9.10</a>, <a class="xref" href=
          "../general/libxslt.html" title=
          "libxslt-1.1.34">libxslt-1.1.34</a>, <a class="xref" href=
          "openldap.html" title="OpenLDAP-2.4.49">OpenLDAP-2.4.49</a>,
          <a class="xref" href="../postlfs/linux-pam.html" title=
          "Linux-PAM-1.3.1">Linux-PAM-1.3.1</a>, <a class="xref" href=
          "../postlfs/mitkrb.html" title="MIT Kerberos V5-1.18">MIT Kerberos
          V5-1.18</a> and <a class="ulink" href=
          "https://developer.apple.com/bonjour/">Bonjour</a>
        </p>
        <h4>
          Optional (To Regenerate Documentation)
        </h4>
        <p class="optional">
          <a class="xref" href="../pst/fop.html" title="fop-2.4">fop-2.4</a>,
          <a class="xref" href="../pst/sgml-dtd.html" title=
          "docbook-4.5">docbook-4.5</a>, <a class="xref" href=
          "../pst/docbook-dsssl.html" title=
          "docbook-dsssl-1.79">docbook-dsssl-1.79</a>, <a class="xref" href=
          "../pst/docbook-utils.html" title=
          "DocBook-utils-0.6.14">DocBook-utils-0.6.14</a>, <a class="xref"
          href="../pst/openjade.html" title=
          "OpenJade-1.3.2">OpenJade-1.3.2</a>, and <a class="xref" href=
          "../general/perl-modules.html#perl-sgmlspm" title=
          "SGMLSpm-1.1">SGMLSpm-1.1</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/postgresql">http://wiki.linuxfromscratch.org/blfs/wiki/postgresql</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of PostgreSQL
        </h2>
        <p>
          For enhanced security, it is better to have a dedicated group and
          user for running the PostgreSQL server. First, issue as the
          <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">groupadd -g 41 postgres &amp;&amp;
useradd -c "PostgreSQL Server" -g postgres -d /srv/pgsql/data \
        -u 41 postgres</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            There are several configuration items that add additional
            functionality with optional packages to <span class=
            "application">PostgreSQL</span>. Use <span class=
            "command"><strong>./configure --help</strong></span> to see a
            list.
          </p>
        </div>
        <p>
          Install <span class="application">PostgreSQL</span> with the
          following commands:
        </p>
        <pre class="userinput">
<kbd class=
"command">sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &amp;&amp;

./configure --prefix=/usr          \
            --enable-thread-safety \
            --docdir=/usr/share/doc/postgresql-12.2 &amp;&amp;
make</kbd>
</pre>
        <p>
          There are a number of programs in the <code class=
          "filename">contrib/</code> directory. If you are going to run this
          installation as a server and wish to build some of them, enter
          <span class="command"><strong>make -C contrib</strong></span> or
          <span class="command"><strong>make -C contrib/<em class=
          "replaceable"><code>&lt;SUBDIR-NAME&gt;</code></em></strong></span>
          for each subdirectory.
        </p>
        <p>
          Tests must be run as an unprivileged user because they need to
          start a temporary server and this is prevented as the root user.
          For the same reason, you need to stop all PostgreSQL servers if any
          are running. If a previous version of PostgreSQL is installed, it
          may be necessary to use <span class=
          "command"><strong>--disable-rpath</strong></span> with <span class=
          "command"><strong>configure</strong></span> to avoid failures, but
          <span class="emphasis"><em>installing the binaries created using
          this switch is not recommended</em></span>. To test the results,
          issue: <span class="command"><strong>make check</strong></span>.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install      &amp;&amp;
make install-docs</kbd>
</pre>
        <p>
          If you made any of the <code class="filename">contrib/</code>
          programs, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="userinput">
<kbd class="command">make -C contrib/<em class=
"replaceable"><code>&lt;SUBDIR-NAME&gt;</code></em> install</kbd>
</pre>
        <div class="admon tip">
          <img alt="[Tip]" src="../images/tip.png" />
          <h3>
            Tip
          </h3>
          <p>
            If you only intend to use <span class=
            "application">PostgreSQL</span> as a client to connect to a
            server on another machine, your installation is complete and you
            should not run the remaining commands.
          </p>
        </div>
        <p>
          Initialize a database cluster with the following commands issued by
          the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">install -v -dm700 /srv/pgsql/data &amp;&amp;
install -v -dm755 /run/postgresql &amp;&amp;
chown -Rv postgres:postgres /srv/pgsql /run/postgresql</kbd>
</pre>
        <p>
          Now, initialize the database as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">su - postgres -c '/usr/bin/initdb -D /srv/pgsql/data'</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <span class="command"><strong>sed -i ...</strong></span>: This sed
          changes server socket location from <code class=
          "filename">/tmp</code> to <code class=
          "filename">/run/postgresql</code>.
        </p>
        <p>
          <em class="parameter"><code>--enable-thread-safety</code></em>:
          This switch makes the client libraries thread-safe by allowing
          concurrent threads in <code class="filename">libpq</code> and ECPG
          programs to safely control their private connection handles.
        </p>
        <p>
          <code class="option">--with-openssl</code>: builds the package with
          support for <span class="application">OpenSSL</span> encrypted
          connections.
        </p>
        <p>
          <code class="option">--with-perl</code>: builds the PL/Perl
          server-side language.
        </p>
        <p>
          <code class="option">--with-python</code>: builds the PL/Python
          server-side language. Add PYTHON=/usr/bin/python2 for Python2
          support, otherwise Python3 is used by default.
        </p>
        <p>
          <code class="option">--with-tcl</code>: builds the PL/Tcl
          server-side language.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring PostgreSQL
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="postgresql-config" name="postgresql-config"></a>
          </h3>
          <h4 class="title">
            <a id="postgresql-config" name="postgresql-config"></a>Config
            Files
          </h4>
          <p>
            <code class="filename">$PGDATA/pg_ident.con</code>, <code class=
            "filename">$PGDATA/pg_hba.conf</code>, and <code class=
            "filename">$PGDATA/postgresql.conf</code>
          </p>
          <p>
            The <code class="envar">PGDATA</code> environment variable is
            used to distinguish database clusters from one another by setting
            it to the value of the directory which contains the cluster
            desired. The three configuration files exist in every
            <code class="filename">PGDATA/</code> directory. Details on the
            format of the files and the options that can be set in each can
            be found in <code class=
            "filename">/usr/share/doc/postgresql-12.2/html/index.html</code>.
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="postgresql-init" name="postgresql-init"></a>
          </h3>
          <h4 class="title">
            <a id="postgresql-init" name="postgresql-init"></a><span class=
            "phrase">Boot Script</span>
          </h4>
          <p>
            Install the <span class="phrase"><code class=
            "filename">/etc/rc.d/init.d/postgresql</code> init script</span>
            included in the <a class="xref" href=
            "../introduction/bootscripts.html" title=
            "BLFS Boot Scripts">blfs-bootscripts-20191204</a> package:
          </p>
          <pre class="root">
<kbd class="command">make install-postgresql</kbd>
</pre>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3"></h3>
          <h4 class="title">
            <a id="idm140006436371568" name="idm140006436371568"></a>Starting
            the PostgreSQL Server and Creating a Sample Database
          </h4>
          <p>
            The database server can be manually started with the following
            command (as the <code class="systemitem">root</code> user):
          </p>
          <pre class="root">
<kbd class=
"command">su - postgres -c '/usr/bin/postgres -D /srv/pgsql/data &gt; \
                  /srv/pgsql/data/logfile 2&gt;&amp;1 &amp;'</kbd>
</pre>
          <div class="admon note">
            <img alt="[Note]" src="../images/note.png" />
            <h3>
              Note
            </h3>
            <p>
              If you are scripting this part, you should wait for the server
              to start before going on, by adding for example <span class=
              "command"><strong>sleep 2</strong></span> after the above
              command.
            </p>
          </div>
          <p>
            The instructions below show how to create a database, add a table
            to it, insert some rows into the table and select them, to verify
            that the installation is working properly. Still as user
            <code class="systemitem">root</code>, issue:
          </p>
          <pre class="root">
<kbd class="command">su - postgres -c '/usr/bin/createdb test' &amp;&amp;
echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
    | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
echo "insert into t1 values ('Billy', 'NewYork');" \
    | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
echo "insert into t1 values ('Evanidus', 'Quebec');" \
    | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
echo "insert into t1 values ('Jesse', 'Ontario');" \
    | (su - postgres -c '/usr/bin/psql test ') &amp;&amp;
echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</kbd>
</pre>
          <p>
            When you are done with testing, you can shut down the server, by
            issuing as <code class="systemitem">root</code>:
          </p>
          <pre class="root">
<kbd class=
"command">su - postgres -c "/usr/bin/pg_ctl stop -D /srv/pgsql/data"</kbd>
</pre>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">clusterdb, createdb, createuser, dropdb,
              dropuser, ecpg, initdb, pg_archivecleanup, pg_basebackup,
              pg_config, pg_controldata, pg_ctl, pg_dump, pg_dumpall,
              pg_isready, pg_receivewal, pg_recvlogical, pg_resetwval,
              pg_restore, pg_rewind, pg_test_fsync, pg_test_timing,
              pg_upgrade, pg_waldump, pgbench, postgres, postmaster
              (deprecated), psql, reindexdb, vacuumdb, optionally, if Tcl
              support has been built, pltcl_delmod, pltcl_listmod,
              pltcl_loadmod, and optionally (in contrib/) oid2name,
              pg_standby, vacuumlo, and many others</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">libecpg.{so,a}, libecpg_compat.{so,a},
              libpgcommon.a, libpgport.a, libpgtypes.{so,a}, libpq.{so,a},
              various charset modules, and optionally programming language
              modules under /usr/lib/postgresql</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/usr/include/{libpq,postgresql},
              /usr/lib/postgresql,
              /usr/share/{doc/postgresql-12.2,postgresql}, and
              /srv/pgsql</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="clusterdb" name="clusterdb"></a><span class=
                    "term"><span class=
                    "command"><strong>clusterdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a utility for reclustering tables in a <span class=
                    "application">PostgreSQL</span> database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="createdb" name="createdb"></a><span class=
                    "term"><span class=
                    "command"><strong>createdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    creates a new <span class="application">PostgreSQL</span>
                    database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="createuser" name="createuser"></a><span class=
                    "term"><span class=
                    "command"><strong>createuser</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    defines a new <span class="application">PostgreSQL</span>
                    user account.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="dropdb" name="dropdb"></a><span class=
                    "term"><span class=
                    "command"><strong>dropdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    removes a <span class="application">PostgreSQL</span>
                    database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="dropuser" name="dropuser"></a><span class=
                    "term"><span class=
                    "command"><strong>dropuser</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    removes a <span class="application">PostgreSQL</span>
                    user account.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="ecpg" name="ecpg"></a><span class=
                    "term"><span class=
                    "command"><strong>ecpg</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the embedded SQL preprocessor.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="initdb" name="initdb"></a><span class=
                    "term"><span class=
                    "command"><strong>initdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    creates a new database cluster.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="oid2name" name="oid2name"></a><span class=
                    "term"><span class=
                    "command"><strong>oid2name</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    resolves OIDs (Object IDs) and file nodes in a PostgreSQL
                    data directory.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_archivecleanup" name=
                    "pg_archivecleanup"></a><span class="term"><span class=
                    "command"><strong>pg_archivecleanup</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    cleans up PostgreSQL WAL (write-ahead log) archive files.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_basebackup" name=
                    "pg_basebackup"></a><span class="term"><span class=
                    "command"><strong>pg_basebackup</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    takes base backups of a running <span class=
                    "application">PostgreSQL</span> cluster.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_config" name="pg_config"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_config</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    retrieves <span class="application">PostgreSQL</span>
                    version information.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_controldata" name=
                    "pg_controldata"></a><span class="term"><span class=
                    "command"><strong>pg_controldata</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    returns information initialized during <span class=
                    "command"><strong>initdb</strong></span>, such as the
                    catalog version and server locale.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_ctl" name="pg_ctl"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_ctl</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    controls stopping and starting the database server.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_dump" name="pg_dump"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_dump</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    dumps database data and metadata into scripts which are
                    used to recreate the database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_dumpall" name="pg_dumpall"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_dumpall</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    recursively calls <span class=
                    "command"><strong>pg_dump</strong></span> for each
                    database in a cluster.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_isready" name="pg_isready"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_isready</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    checks the connection status of a PostgreSQL server.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_receivewal" name=
                    "pg_receivewal"></a><span class="term"><span class=
                    "command"><strong>pg_receivewal</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is used to stream write-ahead logs from a PostgreSQL
                    server.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_recvlogical" name=
                    "pg_recvlogical"></a><span class="term"><span class=
                    "command"><strong>pg_recvlogical</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    controls PostgreSQL logical decoding streams.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_resetwal" name="pg_resetwal"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_resetwal</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    resets the write-ahead log and other control information
                    of a PostgreSQL database cluster.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_restore" name="pg_restore"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_restore</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    creates databases from dump files created by <span class=
                    "command"><strong>pg_dump</strong></span>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_rewind" name="pg_rewind"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_rewind</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    synchronizes a PostgreSQL data directory with another
                    data directory that was forked from the first one.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_standby" name="pg_standby"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_standby</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    supports the creation of a PostgreSQL warm standby
                    server.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_test_fsync" name=
                    "pg_test_fsync"></a><span class="term"><span class=
                    "command"><strong>pg_test_fsync</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    determines fastest wal_sync method for PostgreSQL.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_test_timing" name=
                    "pg_test_timing"></a><span class="term"><span class=
                    "command"><strong>pg_test_timing</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    measures timing overhead.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_upgrade" name="pg_upgrade"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_upgrade</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    upgrades a PostgreSQL server instance.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pg_waldump" name="pg_waldump"></a><span class=
                    "term"><span class=
                    "command"><strong>pg_waldump</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    displays a human-readable rendering of the write-ahead
                    log of a PostgreSQL database cluster.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pgbench" name="pgbench"></a><span class=
                    "term"><span class=
                    "command"><strong>pgbench</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    runs a benchmark test on PostgreSQL.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pltcl_delmod" name="pltcl_delmod"></a><span class=
                    "term"><span class=
                    "command"><strong>pltcl_delmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a support script used to delete a module from a
                    PL/<span class="application">Tcl</span> table. The
                    command requires the <a class="ulink" href=
                    "http://flightaware.github.io/Pgtcl/">Pgtcl</a> package
                    to be installed also.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pltcl_listmod" name=
                    "pltcl_listmod"></a><span class="term"><span class=
                    "command"><strong>pltcl_listmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a support script used to list the modules in a
                    PL/<span class="application">Tcl</span> table. The
                    command requires the <a class="ulink" href=
                    "http://gborg.postgresql.org/project/pgtcl/">Pgtcl</a>
                    package to be installed also.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pltcl_loadmod" name=
                    "pltcl_loadmod"></a><span class="term"><span class=
                    "command"><strong>pltcl_loadmod</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a support script used to load a module into a
                    PL/<span class="application">Tcl</span> table. The
                    command requires the <a class="ulink" href=
                    "http://gborg.postgresql.org/project/pgtcl/">Pgtcl</a>
                    package to be installed also.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="postgres" name="postgres"></a><span class=
                    "term"><span class=
                    "command"><strong>postgres</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the PostgreSQL database server.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="postmaster" name="postmaster"></a><span class=
                    "term"><span class=
                    "command"><strong>postmaster</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    (deprecated, a symlink to <span class=
                    "command"><strong>postgres</strong></span>) is a
                    multi-user database daemon.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="psql" name="psql"></a><span class=
                    "term"><span class=
                    "command"><strong>psql</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a console based database shell.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="reindexdb" name="reindexdb"></a><span class=
                    "term"><span class=
                    "command"><strong>reindexdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a utility for rebuilding indexes in a database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="vacuumdb" name="vacuumdb"></a><span class=
                    "term"><span class=
                    "command"><strong>vacuumdb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    compacts databases and generates statistics for the query
                    analyzer.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="vacuumlo" name="vacuumlo"></a><span class=
                    "term"><span class=
                    "command"><strong>vacuumlo</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    removes orphaned large objects from a PostgreSQL
                    database.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libecpg" name="libecpg"></a><span class=
                    "term"><code class=
                    "filename">libecpg.{so,a}</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    contains functions to support embedded SQL in C programs.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libecpg_compat" name=
                    "libecpg_compat"></a><span class="term"><code class=
                    "filename">libecpg_compat.{so,a}</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the ecpg compatibility library.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libgport" name="libgport"></a><span class=
                    "term"><code class="filename">libgport.a</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the port-specific subsystem of the Postgres backend.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libpgtypes" name="libpgtypes"></a><span class=
                    "term"><code class=
                    "filename">libpgtypes.{so,a}</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    contains functions for dealing with Postgres data types.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libpq" name="libpq"></a><span class=
                    "term"><code class="filename">libpq.{so,a}</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the C programmer's API to Postgres.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-07 03:40:50 -0600
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="mariadb.html" title=
          "MariaDB-10.4.12">Prev</a>
          <p>
            MariaDB-10.4.12
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="sqlite.html" title="SQLite-3.31.1">Next</a>
          <p>
            SQLite-3.31.1
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="databases.html" title=
          "Chapter&nbsp;22.&nbsp;Databases">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
